home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 1996 May / Software of the Month Club 1996 May.iso / mac / ISO9660 / ZIPFILES / BMPWIZ.ZIP / MOSAIC.BAS < prev    next >
Unknown  |  1995-12-12  |  1.6 KB

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was not able to be converted.
This format is not currently supported by dexvert.

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert GW-BASIC (document/gwBasic) ext Supported
66% dexvert GFA-BASIC Atari (other/gfaBASICAtari) ext Supported
1% dexvert Amiga BASIC Protected File (other/amigaBASICProtectedFile) ext Unsupported
1% dexvert BAS VBDOS Pro 1.0 Source (other/basVBDOSPro10Source) ext Unsupported
1% dexvert Visual Basic Tokenized Source (other/visualBasicTokenizedSource) ext Unsupported
1% dexvert ZBASIC (other/zbasic) ext Unsupported
100% file data default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 37 06 00 00 0d 0a 27 20 | 4d 6f 73 61 69 63 2e 0d |7.....' |Mosaic..|
|00000010| 0a 27 20 43 61 6c 63 20 | 61 76 65 72 61 67 65 20 |.' Calc |average |
|00000020| 63 6f 6c 6f 72 20 6f 66 | 20 65 76 65 72 79 20 72 |color of| every r|
|00000030| 65 63 74 20 70 61 69 6e | 74 69 6e 67 20 69 6e 20 |ect pain|ting in |
|00000040| 74 68 65 20 64 65 73 74 | 69 6e 61 74 69 6f 6e 20 |the dest|ination |
|00000050| 74 68 65 20 52 47 42 20 | 76 61 6c 75 65 2e 0d 0a |the RGB |value...|
|00000060| 27 20 46 6f 72 20 61 20 | 62 65 74 74 65 72 20 61 |' For a |better a|
|00000070| 6e 64 20 66 61 73 74 65 | 72 20 72 65 73 75 6c 74 |nd faste|r result|
|00000080| 20 75 73 65 20 32 34 20 | 62 69 74 20 6f 75 74 70 | use 24 |bit outp|
|00000090| 75 74 2e 0d 0a 0d 0a 27 | 20 49 6e 70 75 74 3a 09 |ut.....'| Input:.|
|000000a0| 34 2d 38 2d 32 34 20 62 | 69 74 0d 0a 27 20 4f 75 |4-8-24 b|it..' Ou|
|000000b0| 74 70 75 74 3a 09 34 2d | 38 2d 32 34 20 62 69 74 |tput:.4-|8-24 bit|
|000000c0| 0d 0a 0d 0a 27 20 41 75 | 74 68 6f 72 3a 09 41 6e |....' Au|thor:.An|
|000000d0| 64 72 65 61 20 42 65 6e | 6f 6e 69 09 09 09 20 72 |drea Ben|oni... r|
|000000e0| 65 76 3a 09 31 2e 32 0d | 0a 0d 0a 0d 0a 73 74 72 |ev:.1.2.|.....str|
|000000f0| 69 6e 67 20 20 20 20 09 | 69 6e 70 46 69 6c 65 2c |ing .|inpFile,|
|00000100| 6f 75 74 46 69 6c 65 0d | 0a 44 65 76 43 6f 6e 09 |outFile.|.DevCon.|
|00000110| 49 62 6d 70 2c 4f 62 6d | 70 0d 0a 52 47 42 09 70 |Ibmp,Obm|p..RGB.p|
|00000120| 69 78 0d 0a 66 6c 6f 61 | 74 20 20 09 78 2c 79 2c |ix..floa|t .x,y,|
|00000130| 78 6d 2c 79 6d 2c 78 74 | 2c 79 74 2c 73 2c 74 2c |xm,ym,xt|,yt,s,t,|
|00000140| 72 2c 67 2c 62 0d 0a 0d | 0a 73 3d 36 09 09 09 09 |r,g,b...|.s=6....|
|00000150| 09 09 27 20 72 65 63 74 | 20 73 69 64 65 0d 0a 74 |..' rect| side..t|
|00000160| 3d 31 09 09 09 09 09 09 | 27 20 62 6c 61 63 6b 20 |=1......|' black |
|00000170| 6c 69 6e 65 20 74 68 69 | 63 6b 0d 0a 69 6e 70 46 |line thi|ck..inpF|
|00000180| 69 6c 65 3d 22 54 65 73 | 74 69 2e 62 6d 70 22 09 |ile="Tes|ti.bmp".|
|00000190| 09 09 09 27 20 69 6e 70 | 75 74 20 66 69 6c 65 0d |...' inp|ut file.|
|000001a0| 0a 6f 75 74 46 69 6c 65 | 3d 22 54 65 73 74 6f 2e |.outFile|="Testo.|
|000001b0| 62 6d 70 22 09 09 09 09 | 27 20 6f 75 74 70 75 74 |bmp"....|' output|
|000001c0| 20 66 69 6c 65 0d 0a 0d | 0a 49 62 6d 70 3d 4c 6f | file...|.Ibmp=Lo|
|000001d0| 61 64 49 6d 61 67 65 28 | 69 6e 70 46 69 6c 65 29 |adImage(|inpFile)|
|000001e0| 09 09 09 09 27 20 6c 65 | 67 67 65 20 6c 27 69 6d |....' le|gge l'im|
|000001f0| 6d 61 67 69 6e 65 0d 0a | 78 6d 3d 49 62 6d 70 2e |magine..|xm=Ibmp.|
|00000200| 57 69 64 74 68 2f 73 0d | 0a 79 6d 3d 49 62 6d 70 |Width/s.|.ym=Ibmp|
|00000210| 2e 48 65 69 67 68 74 2f | 73 0d 0a 4f 62 6d 70 3d |.Height/|s..Obmp=|
|00000220| 43 72 65 61 74 65 49 6d | 61 67 65 28 49 62 6d 70 |CreateIm|age(Ibmp|
|00000230| 2e 57 69 64 74 68 2c 49 | 62 6d 70 2e 48 65 69 67 |.Width,I|bmp.Heig|
|00000240| 68 74 2c 32 34 29 27 49 | 62 6d 70 2e 42 69 74 43 |ht,24)'I|bmp.BitC|
|00000250| 6f 75 6e 74 29 0d 0a 09 | 09 09 09 20 20 20 27 20 |ount)...|... ' |
|00000260| 6f 72 20 73 75 62 73 74 | 69 74 75 74 65 20 49 62 |or subst|itute Ib|
|00000270| 6d 70 2e 42 69 74 43 6f | 75 6e 74 20 77 69 74 68 |mp.BitCo|unt with|
|00000280| 20 32 34 0d 0a 0d 0a 69 | 66 28 28 49 62 6d 70 2e | 24....i|f((Ibmp.|
|00000290| 42 69 74 43 6f 75 6e 74 | 3d 38 29 09 7c 28 49 62 |BitCount|=8).|(Ib|
|000002a0| 6d 70 2e 42 69 74 43 6f | 75 6e 74 3d 34 29 29 09 |mp.BitCo|unt=4)).|
|000002b0| 09 09 27 20 69 66 20 34 | 20 6f 72 20 38 20 62 69 |..' if 4| or 8 bi|
|000002c0| 74 20 63 6f 70 79 20 70 | 61 6c 65 74 74 65 0d 0a |t copy p|alette..|
|000002d0| 20 20 46 6f 72 20 79 3d | 30 20 74 6f 20 32 35 35 | For y=|0 to 255|
|000002e0| 0d 0a 20 20 20 20 20 70 | 69 78 3d 47 65 74 50 61 |.. p|ix=GetPa|
|000002f0| 6c 65 74 74 65 28 49 62 | 6d 70 2c 79 29 0d 0a 20 |lette(Ib|mp,y).. |
|00000300| 20 20 20 20 53 65 74 50 | 61 6c 65 74 74 65 28 4f | SetP|alette(O|
|00000310| 62 6d 70 2c 79 2c 70 69 | 78 29 0d 0a 20 20 4e 65 |bmp,y,pi|x).. Ne|
|00000320| 78 74 20 79 0d 0a 45 6e | 64 69 66 0d 0a 0d 0a 74 |xt y..En|dif....t|
|00000330| 3d 74 2b 31 0d 0a 46 6f | 72 20 79 3d 30 20 74 6f |=t+1..Fo|r y=0 to|
|00000340| 20 79 6d 0d 0a 20 20 20 | 44 73 70 57 68 69 6c 65 | ym.. |DspWhile|
|00000350| 28 22 4d 6f 73 61 69 63 | 22 2c 31 30 30 2f 79 6d |("Mosaic|",100/ym|
|00000360| 2a 79 29 0d 0a 20 20 20 | 46 6f 72 20 78 3d 30 20 |*y).. |For x=0 |
|00000370| 74 6f 20 78 6d 0d 0a 20 | 20 20 20 20 20 72 3d 30 |to xm.. | r=0|
|00000380| 0d 0a 20 20 20 20 20 20 | 67 3d 30 0d 0a 20 20 20 |.. |g=0.. |
|00000390| 20 20 20 62 3d 30 0d 0a | 20 20 20 20 20 20 66 6f | b=0..| fo|
|000003a0| 72 20 79 74 3d 79 2a 73 | 20 74 6f 20 79 2a 73 2b |r yt=y*s| to y*s+|
|000003b0| 73 2d 31 09 09 09 27 20 | 63 61 6c 63 20 6f 72 69 |s-1...' |calc ori|
|000003c0| 67 20 52 47 42 20 61 76 | 65 72 61 67 65 0d 0a 20 |g RGB av|erage.. |
|000003d0| 20 20 20 20 20 20 20 20 | 66 6f 72 20 78 74 3d 78 | |for xt=x|
|000003e0| 2a 73 20 74 6f 20 78 2a | 73 2b 73 2d 31 09 0d 0a |*s to x*|s+s-1...|
|000003f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 70 69 78 3d | | pix=|
|00000400| 47 65 74 50 69 78 65 6c | 28 49 62 6d 70 2c 78 74 |GetPixel|(Ibmp,xt|
|00000410| 2c 79 74 29 0d 0a 20 20 | 20 20 20 20 20 20 20 20 |,yt).. | |
|00000420| 20 20 72 3d 72 2b 70 69 | 78 2e 52 65 64 0d 0a 20 | r=r+pi|x.Red.. |
|00000430| 20 20 20 20 20 20 20 20 | 20 20 20 67 3d 67 2b 70 | | g=g+p|
|00000440| 69 78 2e 47 72 65 65 6e | 0d 0a 20 20 20 20 20 20 |ix.Green|.. |
|00000450| 20 20 20 20 20 20 62 3d | 62 2b 70 69 78 2e 42 6c | b=|b+pix.Bl|
|00000460| 75 65 0d 0a 20 20 20 20 | 20 20 20 20 20 6e 65 78 |ue.. | nex|
|00000470| 74 20 78 74 0d 0a 20 20 | 20 20 20 20 6e 65 78 74 |t xt.. | next|
|00000480| 20 79 74 0d 0a 20 20 20 | 20 20 20 70 69 78 2e 52 | yt.. | pix.R|
|00000490| 65 64 3d 72 2f 73 2f 73 | 0d 0a 20 20 20 20 20 20 |ed=r/s/s|.. |
|000004a0| 70 69 78 2e 47 72 65 65 | 6e 3d 67 2f 73 2f 73 0d |pix.Gree|n=g/s/s.|
|000004b0| 0a 20 20 20 20 20 20 70 | 69 78 2e 42 6c 75 65 3d |. p|ix.Blue=|
|000004c0| 62 2f 73 2f 73 0d 0a 0d | 0a 20 20 20 20 20 20 66 |b/s/s...|. f|
|000004d0| 6f 72 20 79 74 3d 79 2a | 73 20 74 6f 20 79 2a 73 |or yt=y*|s to y*s|
|000004e0| 2b 73 2d 74 0d 0a 20 20 | 20 20 20 20 20 20 20 66 |+s-t.. | f|
|000004f0| 6f 72 20 78 74 3d 78 2a | 73 20 74 6f 20 78 2a 73 |or xt=x*|s to x*s|
|00000500| 2b 73 2d 74 09 0d 0a 20 | 20 20 20 20 20 20 20 20 |+s-t... | |
|00000510| 20 20 20 53 65 74 50 69 | 78 65 6c 28 4f 62 6d 70 | SetPi|xel(Obmp|
|00000520| 2c 78 74 2c 79 74 2c 70 | 69 78 29 09 09 27 20 73 |,xt,yt,p|ix)..' s|
|00000530| 65 74 20 61 76 65 72 61 | 67 65 20 52 47 42 20 6f |et avera|ge RGB o|
|00000540| 6e 20 6f 75 74 70 75 74 | 0d 0a 20 20 20 20 20 20 |n output|.. |
|00000550| 20 20 20 6e 65 78 74 20 | 78 74 0d 0a 20 20 20 20 | next |xt.. |
|00000560| 20 20 6e 65 78 74 20 79 | 74 0d 0a 20 20 20 4e 65 | next y|t.. Ne|
|00000570| 78 74 20 78 0d 0a 4e 65 | 78 74 20 79 0d 0a 50 72 |xt x..Ne|xt y..Pr|
|00000580| 65 76 69 65 77 28 49 62 | 6d 70 2c 69 6e 70 46 69 |eview(Ib|mp,inpFi|
|00000590| 6c 65 2c 35 2c 35 2c 49 | 62 6d 70 2e 57 69 64 74 |le,5,5,I|bmp.Widt|
|000005a0| 68 2b 36 2c 49 62 6d 70 | 2e 48 65 69 67 68 74 2b |h+6,Ibmp|.Height+|
|000005b0| 32 30 29 0d 0a 50 72 65 | 76 69 65 77 28 4f 62 6d |20)..Pre|view(Obm|
|000005c0| 70 2c 6f 75 74 46 69 6c | 65 2c 33 32 30 2c 35 2c |p,outFil|e,320,5,|
|000005d0| 4f 62 6d 70 2e 57 69 64 | 74 68 2b 36 2c 4f 62 6d |Obmp.Wid|th+6,Obm|
|000005e0| 70 2e 48 65 69 67 68 74 | 2b 32 30 29 0d 0a 0d 0a |p.Height|+20)....|
|000005f0| 53 61 76 65 49 6d 61 67 | 65 28 4f 62 6d 70 2c 6f |SaveImag|e(Obmp,o|
|00000600| 75 74 46 69 6c 65 29 09 | 09 27 20 53 61 76 65 20 |utFile).|.' Save |
|00000610| 6f 75 74 70 75 74 20 69 | 6d 61 67 65 0d 0a 44 73 |output i|mage..Ds|
|00000620| 70 57 68 69 6c 65 28 22 | 22 2c 30 29 0d 0a 44 73 |pWhile("|",0)..Ds|
|00000630| 70 4d 65 73 28 22 45 6e | 64 22 29 |pMes("En|d") |
+--------+-------------------------+-------------------------+--------+--------+